Simplify
\[\cos \frac{2 \pi}{13} + \cos \frac{6 \pi}{13} + \cos \frac{8 \pi}{13}.\]
Answer: Let $x = \cos \frac{2 \pi}{13} + \cos \frac{6 \pi}{13} + \cos \frac{8 \pi}{13},$ and let $\omega = e^{2 \pi i/13}.$  Then $\omega^{13} = e^{2 \pi i} = 1.$  We see that $x$ is the real part of
\[\omega + \omega^3 + \omega^4.\]Since $|\omega| = 1,$ $\overline{\omega} = \frac{1}{\omega}.$  Thus, $x$ is also the real part of
\begin{align*}
\overline{\omega + \omega^3 + \omega^4} &= \overline{\omega} + \overline{\omega^3} + \overline{\omega^4} \\
&= \frac{1}{\omega} + \frac{1}{\omega^3} + \frac{1}{\omega^4} \\
&= \omega^{12} + \omega^{10} + \omega^9.
\end{align*}Hence,
\[x = \frac{\omega + \omega^3 + \omega^4 + \omega^9 + \omega^{10} + \omega^{12}}{2}.\]From the equation $\omega^{13} = 1,$ $\omega^{13} - 1 = 0,$ which factors as
\[(\omega - 1)(\omega^{12} + \omega^{11} + \omega^{10} + \dots + 1) = 0.\]Since $\omega \neq 1,$
\[1 + \omega + \omega^2 + \dots + \omega^{12} = 0.\]Let
\begin{align*}
\alpha &= \omega + \omega^3 + \omega^4 + \omega^9 + \omega^{10} + \omega^{12}, \\
\beta &= \omega^2 + \omega^5 + \omega^6 + \omega^7 + \omega^8 + \omega^{11}.
\end{align*}Then $\alpha + \beta = \omega + \omega^2 + \omega^3 + \dots + \omega^{12} = -1.$

Also, using the fact that $\omega^{13} = 1,$ the product $\alpha \beta$ simplifies to
\[\alpha \beta = 3 \omega + 3 \omega^2 + \dots + 3 \omega^{12} = -3.\]Hence, $\alpha$ and $\beta$ are the roots of $z^2 + z - 3 = 0.$  By the quadratic formula,
\[z = \frac{-1 \pm \sqrt{13}}{2}.\]Thus, $x = \frac{-1 + \sqrt{13}}{4}$ or $x = \frac{-1 - \sqrt{13}}{4}.$

Note that
\[\cos \frac{8 \pi}{13} = -\cos \left( \pi - \frac{8 \pi}{13} \right) = -\cos \frac{5 \pi}{13},\]so
\[x = \cos \frac{2 \pi}{13} + \cos \frac{6 \pi}{13} + \cos \frac{8 \pi}{13} = \left( \cos \frac{2 \pi}{13} - \cos \frac{5 \pi}{13} \right) + \cos \frac{6 \pi}{13} > 0.\]Therefore,
\[x = \boxed{\frac{\sqrt{13} - 1}{4}}.\]